<template>
    <div class="header">
      <div @click="commonJs.funs(aa,bb)">
        <!-- <svg-icon icon-class="top_icon_back" /> -->
				<!-- <img v-show="right" src="~/static/images/top_icon_back.png" alt=""> -->
				<img class="imgIcon" src="~/static/iconsvgs/top_icon_back.png" alt="">
      </div>
      <h2>{{contentTitle}}</h2>
      <div @click="goto(jumpRoute)">
        <span>{{rightText}}</span>
      </div>
    </div>
</template>

<script>
  export default {
    props: {		
		  rightText: String,
      jumpRoute: String,
      contentTitle: String,
		  right:{
			  type:Boolean,
			  default:true
      },
      aa: String,
      bb: String,
    },
    mounted() {
      if (this.commonJs.isTerminal() == 'isAndroid') {
				if (window.history && window.history.pushState) {
					history.pushState(null, null, document.URL);
					window.addEventListener('popstate', this.fun, false); //false阻止默认事件 
				}
			};
    },
    destroyed() {
      window.removeEventListener('popstate', this.fun, false);
    },
    methods: {
      goto(routerName, queryData) {
				this.$router.push({
					path: routerName,
					query: {
						type: queryData
					}
				});
      },
      fun() {
				this.$router.replace({
					path: this.aa,
					query: {
						type: this.bb
					}
				})
			}
    },
  }
</script>

<style lang="less" scoped>
  .header {
		width: 100%;
		height: 0.88rem;
		text-align: right;
		padding: 0 0.32rem;
		background: #fff;
    font-size: 0.3rem;
    letter-spacing: 0.05rem;
		color: #222;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
		img{
			display: inline-block;
			width: 0.4rem;
			height: 0.4rem;
    }
    h2 {
      font-size: 0.4rem;
      font-weight: 600;
		}
	}
</style>

